# Maintainer: Fabian Bornschein <fabiscafe-at-mailbox-dot-org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=epiphany
pkgver=45.1
pkgrel=1
pkgdesc="A GNOME web browser based on the WebKit rendering engine"
url="https://wiki.gnome.org/Apps/Web"
arch=(loong64 x86_64)
license=(GPL)
depends=(
  gcr-4
  gstreamer
  gtk4
  libadwaita
  libarchive
  libportal-gtk4
  libsoup3
  webkitgtk-6.0
)
makedepends=(
  docbook-xml
  git
  gobject-introspection
  lsb-release
  meson
  startup-notification
  yelp-tools
)
checkdepends=(
  aspell
  glibc-locales
  hspell
  hunspell
  libvoikko
  nuspell
  xorg-server-xvfb
)
groups=(gnome)
_commit=1ab8e71bf2ad6ed4ff4c0c5a251edc10fdaedd95  # tags/45.1^0
source=("git+https://gitlab.gnome.org/GNOME/epiphany.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd epiphany
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd epiphany
}

build() {
  arch-meson epiphany build
  meson compile -C build
}

check() {
  WEBKIT_DISABLE_SANDBOX_THIS_IS_DANGEROUS=1 LC_COLLATE=en_US.UTF-8 \
    dbus-run-session xvfb-run -s '-nolisten local' \
    meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
